/var/www/amaia/lib/core/XMLProcesser.php
/**
* Throws a parse error.
*
* @param string $message The error message
*/
protected function error($message)
{
throw new Exception('XML parse error: "' . $message . '"');
}
}
/var/www/amaia/lib/core/XMLProcesser.php
* Processes an XML file.
*
* @param string $path The path of the XML file
*/
public function process($path)
{
if (!file_exists($path)) {
$this->error('The file does not exist');
}
/var/www/amaia/lib/core/Site.php
/**
* Processes the site data from an XML file.
*/
private function processXMLData()
{
$processer = new XMLProcesser_Site();
$processer->process($this->getPath() . 'site.xml');
// Make sure that the ID defined in the XML is the same as the site's ID!
/var/www/amaia/lib/core/Site.php
if (!$_CONFIG['debug'] && $cachedData = Cache::get('Site::' . $this->id)) {
$this->config['https'] = false;
$this->config = $cachedData['config'];
$this->layout = $cachedData['layout'];
$this->modules = $cachedData['modules'];
} else {
// Process data from the site's XML file
$processedData = $this->processXMLData();
// Store data in cache for later use
/var/www/amaia/lib/core/Site.php
* @param string $id The site's ID
*/
public function __construct($id, $setAsGlobal = true)
{
$this->id = (string) $id;
// Load the site's data
$this->loadData();
// Load the site's group data if needed
/var/www/amaia/lib/core/Application.php
private function getSite($domain)
{
global $_CONFIG;
// If we're in debug mode, we must access a site using its ID as a subdomain!
if (isset($_CONFIG['debug']) && $_CONFIG['debug']) {
if (ends_with($domain, '.' . AMAIA_DEBUG_DOMAIN)) {
$site = new Site(str_replace('.' . AMAIA_DEBUG_DOMAIN, '', $domain));
} else {
throw new Exception('Debug mode is active, so you must access your site using the following domain: {siteID}.' . AMAIA_DEBUG_DOMAIN);
/var/www/amaia/lib/core/Application.php
{
Logger::sql('', 'debug');
Logger::sql('----------] ' . $request->domain . $request->path . ' [----------', 'debug');
try {
// Get the site matching the request's domain
$site = $this->getSite($request->domain);
// Apply the URL rewriting rules to the request
/var/www/amaia/www_front/index.php
*/
require('../config.php');
require(AMAIA_LIB . 'functions.php');
require(AMAIA_ROOT . 'autoload.php');
$app = new Application();
$app->handle(Request::buildFromHTTP(Request::TYPE_FRONT));